//
//  MSDayCountCell.m
//  觅尚
//
//  Created by No.8 on 2019/3/27.
//  Copyright © 2019 No.8. All rights reserved.
//

#import "MSDayCountCell.h"
#import "MSDayRoomModel.h"

@implementation MSDayCountCell

+ (instancetype)cellWithTableView:(UITableView *)tableView{
    MSDayCountCell * cell = [tableView dequeueReusableCellWithIdentifier:[MSDayCountCell ID]];
    cell = [[MSDayCountCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:[MSDayCountCell ID]];
    cell.backgroundColor = backgroundcolor;
    return cell;
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self setMember];
    }
    return self;
}
- (void)setMember{
    
    
    self.backView = [[UIView alloc] initWithFrame:CGRectMake(50 * px, 0, ScreenWidth - 100 * px, 120 * px)];
    self.backView.backgroundColor = BackViewColor;
    [self addSubview:self.backView];
    
    self.linView = [[UIView alloc] initWithFrame:CGRectMake(10 * px, self.backView.height - 1, self.backView.width - 20 * px, 1)];
    self.linView.backgroundColor = [UIColor darkGrayColor];
    [self.backView addSubview:self.linView];
    
    
    /** 部门*/
    self.departmentLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, self.backView.width / 3, 120 * px)];
    self.departmentLabel.textColor = WYCRGBColor(102, 121, 145);
    self.departmentLabel.text = @"301";
    self.departmentLabel.textAlignment = NSTextAlignmentCenter;
    self.departmentLabel.font = [UIFont systemFontOfSize:SYRealValue(30 / 2)];
    [self.backView addSubview:self.departmentLabel];
    
    
    
    /** 部门*/
    self.NumberLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.backView.width / 3, self.departmentLabel.y, self.departmentLabel.width, self.departmentLabel.height)];
    self.NumberLabel.textColor = self.departmentLabel.textColor;
    self.NumberLabel.text = @"2";
    self.NumberLabel.textAlignment = NSTextAlignmentCenter;
    self.NumberLabel.font = [UIFont systemFontOfSize:SYRealValue(30 / 2)];
    [self.backView addSubview:self.NumberLabel];
    
    
    /** 部门*/
    self.detailsLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.backView.width / 3 * 2, self.departmentLabel.y, self.departmentLabel.width, self.departmentLabel.height)];
    self.detailsLabel.textColor = WYCRGBColor(0, 211, 184);
    self.detailsLabel.text = @"¥ 2000";
    self.detailsLabel.textAlignment = NSTextAlignmentCenter;
    self.detailsLabel.font = [UIFont systemFontOfSize:SYRealValue(30 / 2)];
    [self.backView addSubview:self.detailsLabel];
}

- (void)setDayRoomModel:(MSDayRoomModel *)DayRoomModel{
    _DayRoomModel = DayRoomModel;
    
    self.departmentLabel.text = [NSString stringWithFormat:@"%@",DayRoomModel.roomName];
    
    self.NumberLabel.text = [NSString stringWithFormat:@"%@",DayRoomModel.roomSize];
    
    self.detailsLabel.text = [NSString stringWithFormat:@"¥ %@",DayRoomModel.roomMoney];
    
}
+(NSString *)ID{
    return @"cell";
}

@end
